package com.easylinkin.linkappapi.building.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.easylinkin.linkappapi.building.entity.Building;
import com.easylinkin.linkappapi.building.vo.BuildingFloorVO;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.util.List;

/**
 * Building表数据库访问层
 *
 * @author CodeGenerator
 * @date 2022/09/21
 */
public interface BuildingMapper extends BaseMapper<Building> {


    /**
     * 查询分页
     *
     * @param page        分页参数对象
     * @param appBuilding 过滤参数对象
     * @return 查询分页结果
     */
    IPage<Building> selectPage(Page page, @Param("appBuilding") Building appBuilding);

    /**
     * 查询单条
     *
     * @param id 主键id
     * @return 查询结果
     */
    Building getOneById(@Param("id") Serializable id);

    /**
     * 查询单体楼层tree数据
     */
    List<BuildingFloorVO> getTree(@Param("tenantId") String tenantId);

    List<BuildingFloorVO> getTreeWithNum(@Param("tenantId") String tenantId);
}

